//main.js
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import websocket from './plugins/websocket' // 引入 WebSocket 插件

Vue.use(ElementUI)

// 注册 WebSocket 插件（传入服务器地址）
Vue.use(websocket, {
  wsUrl: 'ws://localhost:8888/socket/:username', // 支持用户名参数
  store
})

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')